package cn.gdcp.demoa;

import android.app.IntentService;
import android.content.Intent;
import android.util.Log;

public class MyIntentService extends IntentService {
    public MyIntentService() {
        super("MyIntentService");
    }

    @Override
    protected void onHandleIntent(Intent intent) {
        Log.e("onHandleIntent","thread id = " + Thread.currentThread().getId());
        int i = 0;
        while (i<30){
            Log.e("MyIntentService","i = " + i);
            i++;

            try {
                Thread.sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }

    @Override
    public void onCreate() {
        Log.e("MyIntentServiceonCreate","thread id = " + Thread.currentThread().getId());

        super.onCreate();
    }

    @Override
    public void onDestroy() {
        Log.e("MyIntentServiceonCreate","onDestroy");
        super.onDestroy();
    }
}
